home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
DDJ0992.ARJ
/
NOTES.ASC
< prev
next >
Wrap
Text File
|
1992-08-10
|
3KB
|
57 lines
Timer module
During the initial debug phase, we recorded the task response
time in the producer module. We moved this operation into
wait_for_interrupt() in timer.c (see Listing 2). The first ioctl
calls timer_wait_for_int() in the driver with the address of
structure m. The interrupt response time (IRT) and interrupt
service time (IST) are recorded in this structure by the driver.
Then it does a second ioctl which reads the timer value only.
This number is the task response time (TRT). Note that all these
measured times have the inherent overhead of the execution time
for the "read timer" code.
Driver
dcc20a module
The most relevant functions are the timer_interrupt() and
timer_ioctl() funtions.
Timer_interrupt()
We sent the command to the timer board to save the current value
of Timer 1 in the hold register. Then we checked to see if anyone
was waiting for this interrupt by checking interrupt_sem. If
count of the semaphore is less than zero, then somebody is
waiting for itDwhich implies that we met our TCT deadline. We
signal the semaphore to wake up the producer task. Then we save
the value stored in the hold register earlierDthis is the
interrupt response time (IRT). Then we read the next value in the
hold register and save it into the ist_delta variable. These are
all snapshot times that we are reading and saving to be
interpreted and converted into the IRT and IST periods. If
interrupt_sem is not less than zero, then TCT was violated so we
increment the overrun counter. Again we are not measuring the
true interrupt service timeDwe are measuring the time minus a
constant. However, this time is still quite accurate because the
bulk of the time here is spent in ssignal() where we make the
producer (which was blocked) runnable.
timer_ioctl()
case TIMER_WAIT_FOR_INT:
Essentially as long we do the swait() call before the next
interrupt comes in, we do not get an overrun. If we do the
swait() after the interrupt comes in, then we are going to get an
overrun which is detected in the timer_interrupt() routine. Then
we copy the drt and ist_delta into a structure that the
application passes.The interrupts are disabled here so if we
overrun our data integrity is maintained.
Display module
This module was modified but the basic structure is identical to
the skeleton we built. We created a double buffering scheme to
keep a running minimum and maximum for all the different response
times. We compute how many times to run through the double
buffers before printing the data to the screen. The printing is
done by another thread spun off by the display thread.